(function($, window) {
	var baseRequest = window.baseRequest;
	var appConfig = window.appConfig;
	var commonTool = window.commonTool;
	var dataManager = window.dataManager;
	var baseUrl = appConfig.v3ServiceUrl + '/portalmonitor';

	var v3PortalMonitor = window.v3PortalMonitor = {};

	//add by dongjuanying
	
	//endac

	//add by zhangfuqiang
	
	//end

	//add by ding
	var getAuthUserCountUrl = baseUrl + "/portalusercount?"
	v3PortalMonitor.getAuthUserCount = function(devSN,callback){
		baseRequest.commonGet(getAuthUserCountUrl + $.param({
                devSN: devSN
            }), function (code, data) {
            if (code === 2 || code === 1) {
                return callback(2);
            }
            if (code === 0) {
                if (data == -1 || data.errcode) {
                    callback(1);
                } else {
                    callback(0, data);
                }
            }
        });
	}
	
	//获取认证用户列表
	var getPortalTerminalListUrl = baseUrl + "/app/userlist_page?";
	v3PortalMonitor.getPortalTerminalList = function(devSN,skipNum,limitNum,callback){
		//{"errcode":"illegal access"}
		//{"userList":[{"UpdateFlag":true,"DurationTime":18201,"OnlineTime":"2017-05-08 14:08:58 beijing","timeStamp":0,"OutBytes":3303805,"InBytes":31580632,"UserName":"CC-2D-83-04-4E-57","AuthType":4,"UserIP":"172.168.2.7","UserMac":"cc2d-8304-4e57"}]}
		baseRequest.commonGet(getPortalTerminalListUrl + $.param({
                devSN: devSN,
                skipnum: skipNum,
                limitnum: limitNum
            }), function (code, data) {
            if (code === 2 || code === 1) {
                return callback(2);
            }
            if (code === 0) {
                if (data == -1 || data.errcode) {
                    callback(1);
                } else {
                    callback(0, data);
                }
            }
        });
	}
	
	//end

	//add by wangyu

	//end

	//add by wuchengcheng

	//end

})(mui, window);